/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * File Name          : app_freertos.c
  * Description        : Code for freertos applications
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under Ultimate Liberty license
  * SLA0044, the "License"; You may not use this file except in compliance with
  * the License. You may obtain a copy of the License at:
  *                             www.st.com/SLA0044
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Includes ------------------------------------------------------------------*/
#include "FreeRTOS.h"
#include "task.h"
#include "main.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "potentiometer.h"
#include "regular_conversion_manager.h"
/* USER CODE END Includes */

/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD */

/* USER CODE END PTD */

/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */

/* USER CODE END PD */

/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM */

/* USER CODE END PM */

/* Private variables ---------------------------------------------------------*/
/* USER CODE BEGIN Variables */
extern RegConv_t  PotentiometerConv;
extern uint8_t PotentiometerHandle;
/* USER CODE END Variables */

/* Private function prototypes -----------------------------------------------*/
/* USER CODE BEGIN FunctionPrototypes */

/* USER CODE END FunctionPrototypes */

/* Private application code --------------------------------------------------*/
/* USER CODE BEGIN Application */
void status_led_task(void const * argument)
{
  while(1)
  {
    HAL_GPIO_TogglePin(STATUS_LED_GPIO_Port,STATUS_LED_Pin);
    vTaskDelay(500);
  }
}
void poten_control_task(void const * argument)
{
  PotentiometerConv.regADC = ADC1 ;
  PotentiometerConv.channel = MC_ADC_CHANNEL_11;
  PotentiometerConv.samplingTime = ADC_SAMPLETIME_6CYCLES_5;
  PotentiometerHandle = RCM_RegisterRegConv (&PotentiometerConv);
  while(1)
  {
    PotentiometerControl(PotentiometerHandle);
    vTaskDelay(2);
  }
}
/* USER CODE END Application */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
